<?php
/**
* @package Frontend-User-Access (com_frontenduseraccess)
* @version 3.0.8
* @copyright Copyright (C) 2008 Carsten Engel. All rights reserved.
* @license GPL versions free/trial/pro
* @author http://www.pages-and-items.com
* @joomla Joomla is Free Software
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

function com_uninstall(){ 

	$database = JFactory::getDBO();		

	$database->setQuery( "SELECT id, params "
	. "\nFROM #__modules "				
	. "\nWHERE client_id='0' "		
	);		
	$modules = $database->loadObjectList();
	
	foreach($modules as $module){			
		$id = $module->id;
		$params = $module->params;								
		$classname = 'frontend_user_access_module_hide_'.$id.'_';							
		if(strpos($params, $classname)){							
			$params = str_replace($classname,'',$params);
			$database->setQuery( "UPDATE #__modules SET params='$params' WHERE id='$id' ");
			$database->query();	
		}					
	}	 
	
}

?>
<div style="width: 500px; text-align: left;">
	<h2>Frontend-User-Access</h2>	
	<p>
		Thank you for having used Frontend-User-Access.
	</p>
	<p>
		Why did you uninstall this component? Missing any features? <a href="http://www.pages-and-items.com/" target="_blank">Let us know</a>.		
	</p>	
	<p>
		Check <a href="http://www.pages-and-items.com/" target="_blank">www.pages-and-items.com</a> for:
		<ul>
			<li>updates</li>
			<li>support</li>
			<li>documentation</li>
			<li>email notification service for updates and new extensions</li>	
		</ul>
	</p>	
</div>